pdf(
    paste0(
        ifelse(
            glove_embeddings,
            "figs/labeled_tweets_over_time_glove_replicate_psrm.pdf",
            "figs/Figure2_FigureA5_labeled_tweets_over_time_replicate_psrm.pdf"
        )
    ),
    width=13, height=10
)

par(mfrow=c(2, 2), mar=c(4, 5, 4, 4))

#### ## bar plot of topic proportions
####
barplot(
    t(
        as.matrix(
            rbind(rev(props_l), rev(props_r))
        )
    ),
    beside=T,
    col=c(
        rev(c("purple","orange","blue")),
        rev(c("purple","orange","red"))
    ),
    ylim=c(0, 0.8), yaxt="n", main="Fraction of Tweets\n(hand labels)",
    cex.lab=1.5
)
axis(2, at=seq(0, 0.5, 0.1), cex.axis=1.4)
axis(
    1, at=c(2.5, 6.5),
    labels=c("Left trolls", "Right trolls"), tick=F, cex.axis=1.5
)
legend(
    "topleft",
    legend=c(
        "Entertainment","Politics (left)",
        "Politics (right)","Social Justice \n/ Race Relations"
    ),
    lty=1, col=c("orange","blue", "red","purple"), bty="n", cex=1.5
)





## timeline of tweet frequency by account type
with(
    aggregated_tweets_left,             #_full (same obj no truncation in either)
    plot(
        tweet_date, n_tweets, type="l", col="gray", bty="n", lwd=4,
        xlab="Date (weekly)", ylab="Number of Tweets", main="",
        xlim=c(as.Date("2016-05-01"), as.Date("2016-11-08")),
        cex.lab=1.5, cex.axis=1.5
    )
)
with(
    aggregated_tweets_right,            #_full
    lines(tweet_date, n_tweets, type="l", col="black", lwd=4)
)
legend(
    "topleft", legend=c("Left trolls", "Right trolls"),
    lty=1, col=c("gray", "black"), bty="n", cex=1.5, lwd=4
)




#### timeline of topic frequency by account type
## save to repeat in si

## left
p1.pryr %<a-% {
with(
    aggregated_tweets_left,
    plot(
        tweet_date, (politics_p + social_justice_p), type="l", col="blue", bty="n",
        ylim=c(0, 1.15), lwd=4, xlab="Date (weekly)", ylab="Fraction of Tweets",
        main="Left Trolls", xlim=c(as.Date("2016-05-01"), as.Date("2016-11-08")),
        cex.lab=1.5, cex.axis=1.5, cex.main=1.3
    )
)
with(
    aggregated_tweets_left,
    lines(tweet_date, entertainment_p, type="l", col="orange", lwd=4)
)
mtext(text="2016-10-02", at=lubridate::floor_date(as.Date("2016-10-02"), unit="week"))
legend(
    "topleft",
    legend=c("Entertainment","Politics + \nSocial Justice / Race Relations","Hand Labels"),
    lty=c(1, 1, 2), pch=c(NA, NA, 16), col=c("orange","blue","black"), bty="n", cex=1.5
)
abline(h=seq(0.1, 0.8, 0.1), lty=3)
##
attach(aggregated_tweets_m_left)
lines(
    tweet_date, entertainment_a,
    type="l", col="orange", bty="n", ylim=c(0, 1), lwd=2,
    xlab="Date (weekly)", ylab="Fraction of Tweets", main="Left Trolls", lty=2
)
points(
    tweet_date, entertainment_a,
    col="orange", bty="n", ylim=c(0, 1), lwd=2,
    xlab="Date (weekly)", ylab="Fraction of Tweets", main="Left Trolls", lty=2, pch=16, cex=1.5
)
lines(
    tweet_date, (politics_a + social_justice_a),
    col="blue", lwd=2, lty=2
)
points(
    tweet_date, (politics_a + social_justice_a),
    col="blue", lwd=2, lty=2, pch=16, cex=1.5
)
detach(aggregated_tweets_m_left)
}

## right
p2.pryr %<a-% {
with(
    aggregated_tweets_right,
    plot(
        tweet_date, entertainment_p, type="l", col="orange", bty="n",
        ylim=c(0, 1.15), lwd=4, xlab="Date (weekly)", ylab="Fraction of Tweets",
        main="Right Trolls", xlim=c(as.Date("2016-05-01"), as.Date("2016-11-08")),
        cex.lab=1.5, cex.axis=1.5, cex.main=1.3
    )
)
with(
    aggregated_tweets_right,
    lines(tweet_date, (politics_p + social_justice_p), type="l", col="red", lwd=4)
)
mtext(text="2016-10-02", at=lubridate::floor_date(as.Date("2016-10-02"), unit="week"))
legend(
    "topleft",
    legend=c("Entertainment","Politics + \nSocial Justice / Race Relations", "Hand Labels"),
    lty=c(1, 1, 2), pch=c(NA, NA, 16), col=c("orange","red","black"), bty="n", cex=1.3
)
abline(h=seq(0.1, 0.8, 0.1), lty=3)
attach(aggregated_tweets_m_right)
lines(
    tweet_date, entertainment_a, type="l", col="orange", bty="n",
    ylim=c(0, 1), lwd=2, xlab="Date (weekly)", ylab="Fraction of Tweets",
    main="Left Trolls", lty=2
)
points(
    tweet_date, entertainment_a, col="orange", bty="n",
    ylim=c(0, 1), lwd=2, xlab="Date (weekly)", ylab="Fraction of Tweets",
    main="Left Trolls", lty=2, pch=16, cex=1.5
)
lines(
    tweet_date, (politics_a + social_justice_a), col="red", lwd=2, lty=2
)
points(
    tweet_date, (politics_a + social_justice_a), col="red", lwd=2, lty=2, pch=16, cex=1.3
)
detach(aggregated_tweets_m_right)
}

p1.pryr
p2.pryr

dev.off()


####  ####  ####
####  ####  ####
####  ####  ####
####  ####  ####

pdf(
    paste0(
        ifelse(
            glove_embeddings,
            "figs/FigureA9_labeled_tweets_over_time_si_glove_replicate_psrm.pdf",
            "figs/FigureA6_A12_A13_A14_A15_A16_labeled_tweets_over_time_si_replicate_psrm.pdf"
        )
    ),
    width=13, height=6
)

par(mfrow=c(1, 2), mar=c(4, 5, 4, 4))

####  ####  ####
####  ####  ####
## ANY topics over time

with(
    aggregated_tweets_left,
    plot(
        tweet_date, entertainment_p + politics_p + social_justice_p, type="l",
        ylim=c(0, 1), main="Left Trolls\nlabeled proportion",
        xlab="Date",
        ylab="Entertainment + Politics + Social Justice",
        bty="n", lwd=4, cex.lab=1.3
    )
)

with(
    aggregated_tweets_right,
    plot(
        tweet_date, entertainment_p + politics_p + social_justice_p, type="l",
        ylim=c(0, 1), main="Right Trolls\nlabeled proportion",
        xlab="Date",
        ylab="Entertainment + Politics + Social Justice",
        bty="n", lwd=4, cex.lab=1.3
    )
)


####  ####  ####
####  ####  ####
## topics over time

## left
attach(aggregated_tweets_left)
plot(
    tweet_date, entertainment_p,
    type="l", col="orange", bty="n", ylim=c(0, 1), lwd=4,
    xlab="Date (weekly)", ylab="Fraction of Tweets", main="Left Trolls",
    xlim=c(as.Date("2016-05-01"), as.Date("2016-11-08")), cex.lab=1.3, cex.axis=1.3
)
lines(tweet_date, politics_p, type="l", col="blue", lwd=4)
lines(tweet_date, social_justice_p, type="l", col="purple", lwd=4)
mtext(text="2016-10-02", at=lubridate::floor_date(as.Date("2016-10-02"), unit="week"))
legend(
    "topleft",
    legend=c("Entertainment","Politics","Social Justice / Race Relations"),
    lty=1, col=c("orange","blue","purple"), bty="n", cex=1.25
)
abline(h=seq(0.1, 0.8, 0.1), lty=3)
detach(aggregated_tweets_left)
##
##
attach(aggregated_tweets_m_left)
lines(
    tweet_date, entertainment_a,
    type="l", col="orange", bty="n", ylim=c(0, 1), lwd=2,
    xlab="Date (weekly)", ylab="Fraction of Tweets", main="Left Trolls", lty=2
)
points(
    tweet_date, entertainment_a,
    col="orange", bty="n", ylim=c(0, 1), lwd=2,
    xlab="Date (weekly)", ylab="Fraction of Tweets", main="Left Trolls", lty=2, pch=16, cex=1.5
)
lines(
    tweet_date, (social_justice_a), col="purple", lwd=2, lty=2
)
points(
    tweet_date, (social_justice_a), col="purple", lwd=2, lty=2, pch=16, cex=1.3
)
lines(
    tweet_date, (politics_a),
    col="blue", lwd=2, lty=2
)
points(
    tweet_date, (politics_a),
    col="blue", lwd=2, lty=2, pch=16, cex=1.5
)
detach(aggregated_tweets_m_left)

## right
attach(aggregated_tweets_right)
plot(
    tweet_date, entertainment_p,
    type="l", col="orange", bty="n", ylim=c(0, 1), lwd=4, xlab="Date (weekly)",
    ylab="Fraction of Tweets", main="Right Trolls",
    xlim=c(as.Date("2016-05-01"), as.Date("2016-11-08")), cex.lab=1.3, cex.axis=1.3
)
lines(tweet_date, politics_p, type="l", col="red", lwd=4)
lines(tweet_date, social_justice_p, type="l", col="purple", lwd=4)
mtext(text="2016-10-02", at=lubridate::floor_date(as.Date("2016-10-02"), unit="week"))
legend(
    "topleft",
    legend=c("Entertainment","Politics","Social Justice / Race Relations"),
    lty=1, col=c("orange","red","purple"), bty="n", cex=1.25
)
abline(h=seq(0.1, 0.8, 0.1), lty=3)
detach(aggregated_tweets_right)
##
attach(aggregated_tweets_m_right)
lines(
    tweet_date, entertainment_a, type="l", col="orange", bty="n",
    ylim=c(0, 1), lwd=2, xlab="Date (weekly)", ylab="Fraction of Tweets",
    main="Left Trolls", lty=2
)
points(
    tweet_date, entertainment_a, col="orange", bty="n",
    ylim=c(0, 1), lwd=2, xlab="Date (weekly)", ylab="Fraction of Tweets",
    main="Left Trolls", lty=2, pch=16, cex=1.5
)
lines(
    tweet_date, (social_justice_a), col="purple", lwd=2, lty=2
)
points(
    tweet_date, (social_justice_a), col="purple", lwd=2, lty=2, pch=16, cex=1.3
)
lines(
    tweet_date, (politics_a), col="red", lwd=2, lty=2
)
points(
    tweet_date, (politics_a), col="red", lwd=2, lty=2, pch=16, cex=1.3
)
detach(aggregated_tweets_m_right)



####  ####  ####
####  ####  ####
## topics over time WITH HAND CODES

####  ####  ####
## LEFT

ab.pryr %<a-% {
    rep_debate <- as.Date("2015-08-03")
    segments(
        x0=rep_debate,
        x1=rep_debate,
        y0=0,
        y1=0.8,
        lwd=5,
        lty=2
    )
    ##
    hand_start <- as.Date("2016-06-01")
    segments(
        x0=hand_start,
        x1=hand_start,
        y0=0,
        y1=0.8,
        lwd=5,
        lty=1
    )
    text(x=rep_debate, y=0.85, labels="1", cex=1.5)
    text(x=hand_start, y=0.85, labels="2", cex=1.5)
}

ab.pryr2 %<a-% {
    rep_debate <- as.Date("2015-08-03")
    segments(
        x0=rep_debate,
        x1=rep_debate,
        y0=-0.25,
        y1=0.25,
        lwd=5,
        lty=2
    )
    ##
    hand_start <- as.Date("2016-06-01")
    segments(
        x0=hand_start,
        x1=hand_start,
        y0=-0.25,
        y1=0.25,
        lwd=5,
        lty=1
    )
    text(x=rep_debate, y=0.3, labels="1", cex=1.5)
    text(x=hand_start, y=0.3, labels="2", cex=1.5)
}

attach(aggregated_tweets_left)
plot(
    tweet_date, entertainment_p,
    type="l", col="orange", bty="n", ylim=c(0, 1.15), lwd=2,
    xlab="Date (weekly)", ylab="Fraction of Tweets", main="Right Trolls", cex.lab=1.3
)
lines(
    tweet_date, (politics_p + social_justice_p),
    type="l", col="blue", lwd=2
)
mtext(text="2016-10-02", at=lubridate::floor_date(as.Date("2016-10-02"), unit="week"))
legend(
    "topleft",
    legend=c("Entertainment","Politics + \nSocial Justice / Race Relations", "Hand Labels"),
    lty=c(1, 1, 2), pch=c(NA, NA, 16), col=c("orange","blue","black"), bty="n", cex=1.25
)
##
detach(aggregated_tweets_left)
ab.pryr


####  ####  ####
## RIGHT

attach(aggregated_tweets_right)
plot(
    tweet_date, entertainment_p, type="l", col="orange", bty="n",
    ylim=c(0, 1.15), lwd=2, xlab="Date (weekly)", ylab="Fraction of Tweets",
    main="Right Trolls", cex.lab=1.3
)
lines(
    tweet_date, (politics_p + social_justice_p), type="l", col="red", lwd=2)
mtext(text="2016-10-02", at=lubridate::floor_date(as.Date("2016-10-02"), unit="week"))
legend(
    "topleft",
    legend=c("Entertainment","Politics + \nSocial Justice / Race Relations", "Hand Labels"),
    lty=c(1, 1, 2), col=c("orange","red","black"), pch=c(NA, NA, 16), bty="n", cex=1.25
)
##
detach(aggregated_tweets_right)
ab.pryr



####  ####  ####
####  ####  ####
## ALL THREE topics over time WITH HAND CODES


####  ####  ####
## LEFT

attach(aggregated_tweets_left)
plot(
    tweet_date, entertainment_p, type="l", col="orange", bty="n",
    ylim=c(0, 1.15), lwd=2,
    xlab="Date (weekly)", ylab="Fraction of Tweets", main="Left Trolls", cex.lab=1.3
)
lines(
    tweet_date, politics_p, type="l", col="blue", lwd=2)
lines(
    tweet_date, social_justice_p, type="l", col="purple", lwd=2)
mtext(text="2016-10-02", at=lubridate::floor_date(as.Date("2016-10-02"), unit="week"))
legend(
    "topleft",
    legend=c("Entertainment","Politics","Social Justice / Race Relations", "Hand Labels"),
    lty=c(1, 1, 1, 2), pch=c(NA, NA, NA, 16), col=c("orange","blue","purple","black"), bty="n", cex=1.25
)
##
detach(aggregated_tweets_left)
ab.pryr


####  ####  ####
## RIGHT

attach(aggregated_tweets_right)
plot(
    tweet_date, entertainment_p, type="l", col="orange", bty="n", ylim=c(0, 1.15),
    lwd=2, xlab="Date (weekly)", ylab="Fraction of Tweets", main="Right Trolls", cex.lab=1.3
)
lines(
    tweet_date, politics_p, type="l", col="red", lwd=2)
lines(
    tweet_date, social_justice_p, type="l", col="purple", lwd=2)
mtext(text="2016-10-02", at=lubridate::floor_date(as.Date("2016-10-02"), unit="week"))
legend(
    "topleft",
    legend=c("Entertainment","Politics","Social Justice / Race Relations", "Hand Labels"),
    lty=c(1, 1, 1, 2), pch=c(NA, NA, NA, 16), col=c("orange","red","purple","black"), bty="n", cex=1.25
)
##
detach(aggregated_tweets_right)
ab.pryr


####  ####  ####
####  ####  ####
####  ####  ####
####  ####  ####
## SUPPRESSION

####  ####  ####
####  ####  ####
## MOBILIZE

par(mfrow=c(1, 3), mar=c(4, 5, 4, 4))
with(
    aggregated_tweets_right,
    plot(
        tweet_date, n_vote / n_tweets,
        type="l", col="black", bty="n", lwd=4,
        xlab="Date (weekly)", ylab="Fraction of Tweets",
        main="\"vote\", \"voting\", \"election\", \"support\"",
        xlim=c(as.Date("2015-01-01"), as.Date("2016-11-08")),
        cex.lab=2.5, cex.axis=2.5,
        ylim=c(0, 1)
    )
)
with(
    aggregated_tweets_left,
    lines(
        tweet_date, n_vote / n_tweets,
        type="l", col="gray", bty="n", lwd=4,
        xlab="Date (weekly)", ylab="Fraction of Tweets", main="",
        xlim=c(as.Date("2015-01-01"), as.Date("2016-11-08")),
        cex.lab=1.5, cex.axis=1.5)
)
legend(
    "topleft",
    legend=c("Left trolls", "Right trolls"), lty=1, col=c("gray", "black"),
    bty="n",
    ## cex=1.5,
    cex=2.5,
    lwd=4
)

####  ####  ####
####  ####  ####
## SUPPRESS

with(
    aggregated_tweets_right,
    plot(
        tweet_date, n_no_vote / n_tweets,
        type="l", col="black", bty="n", lwd=4,
        xlab="Date (weekly)", ylab="Fraction of Tweets",
        main="\"vote\", \"voting\", \"election\", \"support\" + \nnegation",
        xlim=c(as.Date("2015-01-01"), as.Date("2016-11-08")),
        cex.lab=2.5, cex.axis=2.5,
        ylim=c(0, 1))
)
with(
    aggregated_tweets_left,
    lines(
        tweet_date, n_no_vote / n_tweets,
        type="l", col="gray", bty="n", lwd=4,
        xlab="Date (weekly)", ylab="Fraction of Tweets", main="",
        xlim=c(as.Date("2015-01-01"), as.Date("2016-11-08")), cex.lab=1.5, cex.axis=1.5)
)
legend(
    "topleft",
    legend=c("Left trolls", "Right trolls"),
    lty=1, col=c("gray", "black"), bty="n",
    ## cex=1.5,
    cex=2.5,
    lwd=4
)



#### tack on repeated hand label comparison
par(mfrow=c(1, 2), mar=c(4, 5, 4, 4))
p1.pryr
p2.pryr

#### #### ####
#### #### ####
## CENTERED MEAN

par(mfrow=c(1, 2), mar=c(4, 6, 4, 4))

with(
    aggregated_tweets_center_mean_left,
    plot(
        tweet_date, (politics_p + social_justice_p), type="l", col="blue", bty="n",
        ylim=c(-0.15, 0.35), lwd=4, xlab="Date (weekly)", ylab="Fraction of Tweets\ncentered at mean",
        main="Left Trolls\naccounts mean centered", xlim=c(as.Date("2016-05-01"), as.Date("2016-11-08")),
        cex.lab=1.5, cex.axis=1.5, cex.main=1.3
    )
)
with(
    aggregated_tweets_center_mean_left,
    lines(tweet_date, entertainment_p, type="l", col="orange", lwd=4)
)
mtext(text="2016-10-02", at=lubridate::floor_date(as.Date("2016-10-02"), unit="week"))
legend(
    "topleft",
    legend=c("Entertainment","Politics + \nSocial Justice / Race Relations","Hand Labels"),
    lty=c(1, 1, 2), pch=c(NA, NA, 16), col=c("orange","blue","black"), bty="n", cex=1.5
)
abline(h=seq(-0.1, 0.2, 0.1), lty=3)


with(
    aggregated_tweets_center_mean_right,
    plot(
        tweet_date, entertainment_p, type="l", col="orange", bty="n",
        ylim=c(-0.15, 0.35), lwd=4, xlab="Date (weekly)", ylab="Fraction of Tweets\ncentered at mean",
        main="Right Trolls\naccounts mean centered", xlim=c(as.Date("2016-05-01"), as.Date("2016-11-08")),
        cex.lab=1.5, cex.axis=1.5, cex.main=1.3
    )
)
with(
    aggregated_tweets_center_mean_right,
    lines(tweet_date, (politics_p + social_justice_p), type="l", col="red", lwd=4)
)
mtext(text="2016-10-02", at=lubridate::floor_date(as.Date("2016-10-02"), unit="week"))
legend(
    "topleft",
    legend=c("Entertainment","Politics + \nSocial Justice / Race Relations", "Hand Labels"),
    lty=c(1, 1, 2), pch=c(NA, NA, 16), col=c("orange","red","black"), bty="n", cex=1.3
)
abline(h=seq(-0.1, 0.2, 0.1), lty=3)

attach(aggregated_tweets_center_mean_left)
plot(
    tweet_date, entertainment_p,
    type="l", col="orange", bty="n", ylim=c(-0.15, 0.35), lwd=4,
    xlab="Date (weekly)", ylab="Fraction of Tweets\ncentered at mean", main="Left Trolls\naccounts mean centered",
    xlim=c(as.Date("2016-05-01"), as.Date("2016-11-08")), cex.lab=1.3, cex.axis=1.3
)
lines(tweet_date, politics_p, type="l", col="blue", lwd=4)
lines(tweet_date, social_justice_p, type="l", col="purple", lwd=4)
mtext(text="2016-10-02", at=lubridate::floor_date(as.Date("2016-10-02"), unit="week"))
legend(
    "topleft",
    legend=c("Entertainment","Politics","Social Justice / Race Relations"),
    lty=1, col=c("orange","blue","purple"), bty="n", cex=1.25
)
abline(h=seq(-0.1, 0.2, 0.1), lty=3)
detach(aggregated_tweets_center_mean_left)


attach(aggregated_tweets_center_mean_right)
plot(
    tweet_date, entertainment_p,
    type="l", col="orange", bty="n", ylim=c(-0.15, 0.35), lwd=4, xlab="Date (weekly)",
    ylab="Fraction of Tweets\ncentered at mean", main="Right Trolls\naccounts mean centered",
    xlim=c(as.Date("2016-05-01"), as.Date("2016-11-08")), cex.lab=1.3, cex.axis=1.3
)
lines(tweet_date, politics_p, type="l", col="red", lwd=4)
lines(tweet_date, social_justice_p, type="l", col="purple", lwd=4)
mtext(text="2016-10-02", at=lubridate::floor_date(as.Date("2016-10-02"), unit="week"))
legend(
    "topleft",
    legend=c("Entertainment","Politics","Social Justice / Race Relations"),
    lty=1, col=c("orange","red","purple"), bty="n", cex=1.25
)
abline(h=seq(-0.1, 0.2, 0.1), lty=3)
detach(aggregated_tweets_center_mean_right)


#### ####
#### ####
## centered mean long

par(mfrow=c(1, 2), mar=c(4, 6, 4, 4))

with(
    aggregated_tweets_center_mean_left,
    plot(
        tweet_date, (politics_p + social_justice_p), type="l", col="blue", bty="n",
        ylim=c(-0.15, 0.35) * 2, lwd=3, xlab="Date (weekly)", ylab="Fraction of Tweets\ncentered at mean",
        main="Left Trolls\naccounts mean centered", xlim=c(as.Date("2014-06-01"), as.Date("2016-11-08")),
        cex.lab=1.5, cex.axis=1.5, cex.main=1.3
    )
)
with(
    aggregated_tweets_center_mean_left,
    lines(tweet_date, entertainment_p, type="l", col="orange", lwd=3)
)
mtext(text="2016-10-02", at=lubridate::floor_date(as.Date("2016-10-02"), unit="week"))
legend(
    "topleft",
    legend=c("Entertainment","Politics + \nSocial Justice / Race Relations","Hand Labels"),
    lty=c(1, 1, 2), pch=c(NA, NA, 16), col=c("orange","blue","black"), bty="n", cex=1.5
)
abline(h=seq(-0.1, 0.2, 0.1), lty=3)
ab.pryr2

with(
    aggregated_tweets_center_mean_right,
    plot(
        tweet_date, entertainment_p, type="l", col="orange", bty="n",
        ylim=c(-0.15, 0.35) * 2, lwd=3, xlab="Date (weekly)", ylab="Fraction of Tweets\ncentered at mean",
        main="Right Trolls\naccounts mean centered", xlim=c(as.Date("2014-06-01"), as.Date("2016-11-08")),
        cex.lab=1.5, cex.axis=1.5, cex.main=1.3
    )
)
with(
    aggregated_tweets_center_mean_right,
    lines(tweet_date, (politics_p + social_justice_p), type="l", col="red", lwd=3)
)
mtext(text="2016-10-02", at=lubridate::floor_date(as.Date("2016-10-02"), unit="week"))
legend(
    "topleft",
    legend=c("Entertainment","Politics + \nSocial Justice / Race Relations", "Hand Labels"),
    lty=c(1, 1, 2), pch=c(NA, NA, 16), col=c("orange","red","black"), bty="n", cex=1.3
)
abline(h=seq(-0.1, 0.2, 0.1), lty=3)
ab.pryr2

attach(aggregated_tweets_center_mean_left)
plot(
    tweet_date, entertainment_p,
    type="l", col="orange", bty="n", ylim=c(-0.15, 0.35) * 2, lwd=3,
    xlab="Date (weekly)", ylab="Fraction of Tweets\ncentered at mean", main="Left Trolls\naccounts mean centered",
    xlim=c(as.Date("2014-06-01"), as.Date("2016-11-08")), cex.lab=1.3, cex.axis=1.3
)
lines(tweet_date, politics_p, type="l", col="blue", lwd=3)
lines(tweet_date, social_justice_p, type="l", col="purple", lwd=3)
mtext(text="2016-10-02", at=lubridate::floor_date(as.Date("2016-10-02"), unit="week"))
legend(
    "topleft",
    legend=c("Entertainment","Politics","Social Justice / Race Relations"),
    lty=1, col=c("orange","blue","purple"), bty="n", cex=1.25
)
abline(h=seq(-0.1, 0.2, 0.1), lty=3)
detach(aggregated_tweets_center_mean_left)
ab.pryr2


attach(aggregated_tweets_center_mean_right)
plot(
    tweet_date, entertainment_p,
    type="l", col="orange", bty="n", ylim=c(-0.15, 0.35) * 2, lwd=3, xlab="Date (weekly)",
    ylab="Fraction of Tweets\ncentered at mean", main="Right Trolls\naccounts mean centered",
    xlim=c(as.Date("2014-06-01"), as.Date("2016-11-08")), cex.lab=1.3, cex.axis=1.3
)
lines(tweet_date, politics_p, type="l", col="red", lwd=3)
lines(tweet_date, social_justice_p, type="l", col="purple", lwd=3)
mtext(text="2016-10-02", at=lubridate::floor_date(as.Date("2016-10-02"), unit="week"))
legend(
    "topleft",
    legend=c("Entertainment","Politics","Social Justice / Race Relations"),
    lty=1, col=c("orange","red","purple"), bty="n", cex=1.25
)
abline(h=seq(-0.1, 0.2, 0.1), lty=3)
detach(aggregated_tweets_center_mean_right)
ab.pryr2


dev.off()
